<html>
<head>
<script language="Javascript" src="../gamelib/gamelib_core.js"></script>
<script language="Javascript" src="../gamelib/gamelib_sprites.js"></script>
<script language="Javascript">

Gl_preloader("../images/whiteanim.gif")

var cdir=0;

function init(){
	cowboy=new Sp_Sprite();				    // make the sprite, called "penguin"
	cowboy.setImage("../images/whiteanim.gif",57,111,8,1); //give it a canvas image, size it 64,64.
							    //the canvas has 11 frames, each with 2
							    // stages of animation.

	cowboy.setXlimits(50,500);	// set x limits for penguin.
	cowboy.setYlimits(150,500);	// set y limits for penguin.
	cowboy.moveTo(0,0);		// move it onto screen.
	cowboy.setSpeed(5);		// speed of 5
	cowboy.setDir(0,1);		// start sprite moving down screen
	cowboy.setFrame(0);		// set it to frame 1 initially (walking right)
	cowboy.switchOn();		// switch it on!
	Gl_scrollbars("off");		// turn off scrollbars
	Gl_hook("animate_cowboy()");	// hook our function to change directions into the gamelib
					// central timer.
	Gl_start();			// start everything moving!
}

function animate_cowboy(){
	cowboy.setFrame(cdir);
	cdir++;
	if(cdir==8) cdir=0;
	if(cowboy.ydir==0&&cowboy.xdir==0){
		cowboy.moveTo(0,0);
		cowboy.setDir(1,1)
	}
}

</script>
</head>
<body bgcolor="#000000" onload="init()">
</body>
</html>